package com.example.project.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;

public class SQLiteNoticia extends SQLiteOpenHelper {
	 
    public SQLiteNoticia(Context context, String name, CursorFactory factory, int version) {
		super(context, name, factory, version);
	}
	
    String sqlCreate = "CREATE TABLE noticia ( idNoticia integer primary key autoincrement,idFoto integer, idCategorias integer, titulo TEXT, fecha DATE, articulo TEXT)";

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(sqlCreate);
    }
 
    @Override
    public void onUpgrade(SQLiteDatabase db, int versionAnterior, int versionNueva) {
        db.execSQL("DROP TABLE IF EXISTS noticia");
        db.execSQL(sqlCreate);
    }
}
